package net.plankton.rules.entities;

import biz.hammurapi.rules.Conclusion;

public class Participant extends Conclusion implements Comparable{

	public Participant(Person p, Event e) {
		setSlot("subject",p);
		setSlot("object",e);
		synchronized (Participant.class) {
			serialNo = ++counter;
		}
	}
	
	public Person getSubject() {
		return (Person)getSlot("subject");
	}
	
	public Event getObject() {
		return (Event) getSlot("object");
	}
	
	protected int serialNo;
	
	protected static int counter = 0;
	
	public int compareTo(Object arg0) {
		 if (arg0==null)
			 return -1;
		return arg0 instanceof Participant 
		? serialNo - ((Participant)arg0).serialNo 
				: hashCode()-arg0.hashCode();
	}

	
	
}
